/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.hcbamk.atm.controllers;

import com.hcbank.classes.Customer;
import com.hcbank.sessionbeans.CustomerSessionBeanRemote;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

/**
 *
 * @author NHAHV
 */
public class CustomerController {
    
    
    public Customer getCustomerById(Integer customerId){
        Customer GetCustomerById = lookupCustomerSessionBeanRemote().GetCustomerById(customerId);
        return GetCustomerById;
    }

    private CustomerSessionBeanRemote lookupCustomerSessionBeanRemote() {
        try {
            Context c = new InitialContext();
            return (CustomerSessionBeanRemote) c.lookup("java:comp/env/CustomerSessionBean");
        } catch (NamingException ne) {
            Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne);
            throw new RuntimeException(ne);
        }
    }
    
    public void logOut(){
        
    }
    
   
}
